<%
_class = object.to_s.classify.constantize
object_string = object.to_s.underscore if object_string.blank?
width = "150px" if width.blank? 
%>
<%= form.select "#{object_string}_id".to_sym, _class.find(:all, {:order => 'name'}).collect{|obj| [obj.name, obj.id]}.insert(0, ['[无]', '']), {}, :style => "width: #{width}" %>
<% fields_for "#{object_string}".to_sym do |object| %>
<%= object.text_field :name, :size => 20, :style=>"display:none" %>
<% end %>
<%= link_to_function "输入", "show_text_field('#{form.object_name}_#{object_string}_id', '#{object_string}_name', this);" %>
